require LWP::UserAgent;

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->show_progress(1);

# $ua->is_online;

# my $response = $ua->get ( 'http://google.com/' );
my $response = $ua->head ( 'http://google.com/' );

if ( $response->is_success ) {
    print $response->decoded_content;  
} else {
    die $response->status_line;
}
